Road Class Reference

#include <Road.h>

List of all members.

Public Member Functions

 Road (RoadType theType)
 ~Road ()
osg::Vec3 calculateCatmull (osg::Vec3 A, osg::Vec3 B, osg::Vec3 C, osg::Vec3 D, double t)
void setPoints (void)
void addDots ()
void addLines (void)
void addNewPoint (osg::Vec3 pos)
string * returnTextName ()
void geometryInitialize ()
void setWidthAndHeight ()

Private Attributes

RoadType type
float width
float length
osg::Vec3 controlPointArray [MaxNUMPOINTS]
osg::Vec3Array * verts
int numControlPoints
int numPoints
int controlPointsIndex
osg::ref_ptr< osg::Group > dotRoot
osg::ref_ptr< osg::Group > lineRoot
osg::ref_ptr< LinearConstraint > dc

Friends

class RoadMap


Detailed Description

Road is the seperate part of the RoadMap which has a fixed width and lane number, RoadMap ise eklenen Road'lari bir vector objesinde tutan kapsayici class theRoadMap is a global object of type RoadMap. The only object used in the project is this one. The variable is inialized as theRoadMap = new RoadMap();. A new kind of a Road object is created by giving an appropriate enumaration type in the constructor. RoadType meaning is as follows: TWO_HALFHALF_HALFHALF: TWO: determines the number of line count of the road. one line divides the road to two lanes. Other determines the type of the lines(full or half lines).


Constructor & Destructor Documentation

Road::Road (  RoadType  theType  ) 
 

constructor takes the type as argument

Road::~Road (   )  [inline]
 


Member Function Documentation

void Road::addDots (   ) 
 

Adds the dot geode to the dotRoot

void Road::addLines (  void   ) 
 

Adss the lines geode to the lineRoot

void Road::addNewPoint (  osg::Vec3  pos  ) 
 

Puts the argumen into the controlPointArray and calls the following respectively: addDots addLines

Parameters:
pos is the point to be added

osg::Vec3 Road::calculateCatmull (  osg::Vec3  A,
osg::Vec3  B,
osg::Vec3  C,
osg::Vec3  D,
double  t
) 
 

Given four points the in between points are calculated.

Parameters:
A is the first point.
B is the second point.
C is the third point.
D is the final point.
t determines the frequency of the point adding.

void Road::geometryInitialize (   ) 
 

sets dc's width height and verts variables.

string* Road::returnTextName (   ) 
 

Returns:
The texture file name according to the the type of the road object

void Road::setPoints (  void   ) 
 

When a new control point is added this function is called

void Road::setWidthAndHeight (   ) 
 

according to the type of Road this function determines the width and length (for texturing purposes) of Road.


Friends And Related Function Documentation

friend class RoadMap [friend]
 


Member Data Documentation

osg::Vec3 Road::controlPointArray[MaxNUMPOINTS] [private]
 

control points for the Roads needed for catmull rom splines

int Road::controlPointsIndex [private]
 

while calculating the spline points, this variable holds from where in the controlPointArray array to send to calculateCatmull

osg::ref_ptr<LinearConstraint> Road::dc [private]
 

conjuction of two roads is handled via this variable

osg::ref_ptr<osg::Group> Road::dotRoot [private]
 

a node that holds control points in this road object

float Road::length [private]
 

length of a linear feature

osg::ref_ptr<osg::Group> Road::lineRoot [private]
 

a node that holds lines draw between control points in this road object

int Road::numControlPoints [private]
 

holds the number of the control points added uptonow

int Road::numPoints [private]
 

holds the number of the points on the spline uptonow

RoadType Road::type [private]
 

the type of the enum determines the road texture and size..

osg::Vec3Array* Road::verts [private]
 

holds all the points calculated on the spline

float Road::width [private]
 

width of a linear feature


The documentation for this class was generated from the following file:
Generated on Sun May 28 18:44:01 2006 by  doxygen 1.4.6-NO